import { View, Text, Button } from 'react-native'
import React from 'react'
import { Link, router } from 'expo-router'
import gss from '../styles/globals'  

export default function ZhIndex() {
    return (
        <View>
            <Text style={gss.h1}>ZhIndex</Text>
            <Text>模板法跳转：</Text>
            <Link href='/home' style={gss.h2}>跳转到/home</Link>
            <Link href='/mine' style={gss.h2}>跳转到/mine</Link>
            <Text>脚本法跳转：</Text>
            <Button title='跳转到/home' onPress={() => {
                router.push('/home')
            }}
            ></Button>
            <Button title='跳转到/mine' onPress={() => {
                router.replace('/mine')
            }}
            ></Button>

            <Link href='/user/login' style={gss.h2}>去登录</Link>
            <Link href='/user/register' style={gss.h2}>去注册</Link>
            {/* 用户访问不存在的页面会访问 +not-found.jsx */}
            <Link href='/user2/register2' style={gss.h2}>去注册2</Link>
        </View>
    )
}